FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build

RUN dotnet tool install -g Microsoft.Web.LibraryManager.Cli
RUN ln -s ~/.dotnet/tools/libman /usr/local/bin/libman

WORKDIR /src
COPY ["src/AbpNet8JqMvc.Web.Mvc/AbpNet8JqMvc.Web.Mvc.csproj", "src/AbpNet8JqMvc.Web.Mvc/"]
COPY ["src/AbpNet8JqMvc.Web.Core/AbpNet8JqMvc.Web.Core.csproj", "src/AbpNet8JqMvc.Web.Core/"]
COPY ["src/AbpNet8JqMvc.Application/AbpNet8JqMvc.Application.csproj", "src/AbpNet8JqMvc.Application/"]
COPY ["src/AbpNet8JqMvc.Core/AbpNet8JqMvc.Core.csproj", "src/AbpNet8JqMvc.Core/"]
COPY ["src/AbpNet8JqMvc.EntityFrameworkCore/AbpNet8JqMvc.EntityFrameworkCore.csproj", "src/AbpNet8JqMvc.EntityFrameworkCore/"]
WORKDIR "/src/src/AbpNet8JqMvc.Web.Mvc"
RUN dotnet restore 

WORKDIR /src
COPY ["src/AbpNet8JqMvc.Web.Mvc", "src/AbpNet8JqMvc.Web.Mvc"]
COPY ["src/AbpNet8JqMvc.Web.Core", "src/AbpNet8JqMvc.Web.Core"]
COPY ["src/AbpNet8JqMvc.Application", "src/AbpNet8JqMvc.Application"]
COPY ["src/AbpNet8JqMvc.Core", "src/AbpNet8JqMvc.Core"]
COPY ["src/AbpNet8JqMvc.EntityFrameworkCore", "src/AbpNet8JqMvc.EntityFrameworkCore"]
WORKDIR "/src/src/AbpNet8JqMvc.Web.Mvc"
RUN libman restore
RUN dotnet publish -c Release -o /publish --no-restore

FROM mcr.microsoft.com/dotnet/aspnet:7.0
EXPOSE 80
WORKDIR /app
COPY --from=build /publish .
ENTRYPOINT ["dotnet", "AbpNet8JqMvc.Web.Mvc.dll"]
